// File:    Cliente.cs
// Author:  Lucas Bittencourt
// Created: quarta-feira, 16 de novembro de 2011 18:32:47
// Purpose: Definition of Class Cliente

using System;
using System.Text;

namespace DA_OOMModel
{
   public class PessoaJuridica
   {
       private int pejIdPessoaJuridica;
       private string pejNmRazaoSocial;
       private string pejNuInscricaoEstadual;
       private string pejNuInscricaoMunicipal;

       private Pessoa pessoa;
      
      /// <summary>
      /// Property for Pessoa
      /// </summary>
      /// <pdGenerated>Default opposite class property</pdGenerated>
      public virtual Pessoa Pessoa
      {
         get
         {
            return pessoa;
         }
         set
         {
               this.pessoa = value;
         }
      }
   
      /// <summary>
      /// Get value of property PejIdPessoaJuridica.
      /// </summary>
      public virtual int PejIdPessoaJuridica
      {
         get
         {
            return pejIdPessoaJuridica;
         }
         set
         {
            if (this.pejIdPessoaJuridica != value)
               this.pejIdPessoaJuridica = value;
         }
      }
      
      /// <summary>
      /// Get value of property PejNmRazaoSocial.
      /// </summary>
      public virtual string PejNmRazaoSocial
      {
         get
         {
            return pejNmRazaoSocial;
         }
         set
         {
            if (this.pejNmRazaoSocial != value)
               this.pejNmRazaoSocial = value;
         }
      }
      
      /// <summary>
      /// Get value of property PejNuInscricaoEstadual.
      /// </summary>
      public virtual string PejNuInscricaoEstadual
      {
         get
         {
            return pejNuInscricaoEstadual;
         }
         set
         {
            if (this.pejNuInscricaoEstadual != value)
               this.pejNuInscricaoEstadual = value;
         }
      }
      
      /// <summary>
      /// Get value of property PejNuInscricaoMunicipal.
      /// </summary>
      public virtual string PejNuInscricaoMunicipal
      {
         get
         {
            return pejNuInscricaoMunicipal;
         }
         set
         {
            if (this.pejNuInscricaoMunicipal != value)
               this.pejNuInscricaoMunicipal = value;
         }
      }
   
      /// <summary>
      /// Get and set primary key class
      /// </summary>
      public virtual PessoaJuridicaPK PessoaJuridicaPK
      {
         get 
         {
            return new PessoaJuridicaPK(pejIdPessoaJuridica);
         }
         set
         {
            if (value != null)
            {
               this.pejIdPessoaJuridica = value.PejIdPessoaJuridica;
            }
         }
      }
   
      /// <summary>
      /// Get hash code
      /// </summary>
      /// <pdGenerated>Get hash code</pdGenerated>
      public override int GetHashCode()
      {
         int _hashCode = 0;
         _hashCode = 29 * PessoaJuridicaPK.GetHashCode();
         if (this.pejNmRazaoSocial != null) 
            _hashCode += 29 * pejNmRazaoSocial.GetHashCode();
      
         if (this.pejNuInscricaoEstadual != null) 
            _hashCode += 29 * pejNuInscricaoEstadual.GetHashCode();
      
         if (this.pejNuInscricaoMunicipal != null) 
            _hashCode += 29 * pejNuInscricaoMunicipal.GetHashCode();
         return _hashCode;
      }
   
      /// <summary>
      /// Test if two objects are equal
      /// </summary>
      /// <param name="object">Object to compare</param>
      /// <pdGenerated>Test if two objects are equal</pdGenerated>
      public override bool Equals(object obj)
      {
         if (obj == null)
            return false;
         PessoaJuridica cast = obj as PessoaJuridica;
         if (!(obj is PessoaJuridica))
            return false;
         if (!this.PessoaJuridicaPK.Equals(cast.PessoaJuridicaPK))
            return false;
         if (this.pejIdPessoaJuridica != cast.PejIdPessoaJuridica)
            return false;
         if (String.Equals(this.pejNmRazaoSocial, cast.PejNmRazaoSocial) == false)
            return false;
      
         if (String.Equals(this.pejNuInscricaoEstadual, cast.PejNuInscricaoEstadual) == false)
            return false;
      
         if (String.Equals(this.pejNuInscricaoMunicipal, cast.PejNuInscricaoMunicipal) == false)
            return false;
      
      
         return true;
      }
   
      /// <summary>
      /// Get object in string format
      /// </summary>
      /// <pdGenerated>Get object in string format</pdGenerated>
      public override string ToString()
      {
         StringBuilder ret = new StringBuilder();
         ret.Append( "PessoaJuridica: " );
         ret.Append( "PejIdPessoaJuridica='" + pejIdPessoaJuridica.ToString() + "'");
         if (pejNmRazaoSocial != null)
            ret.Append( "PejNmRazaoSocial='" + pejNmRazaoSocial.ToString() + "'");
         if (pejNuInscricaoEstadual != null)
            ret.Append( "PejNuInscricaoEstadual='" + pejNuInscricaoEstadual.ToString() + "'");
         if (pejNuInscricaoMunicipal != null)
            ret.Append( "PejNuInscricaoMunicipal='" + pejNuInscricaoMunicipal.ToString() + "'");
         return ret.ToString();
      }
   
   }
}